package kpi.javatraining6.gnatiuk.tests;

import kpi.javatraining6.gnatiuk.src.tester.inout.Input;
import kpi.javatraining6.gnatiuk.src.tester.user.User;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;


public class UserTest {
    private User user;
    @Before
    public void setUp() throws Exception {
        user = new User("jack", "jack");
    }


    @Test
    public void testGetInput() {
        assertEquals(Input.class, Input.getInstance().getClass());
    }
    @Test
    public void testGetNoStatistic() throws Exception {
        String expected = "There is no statistical data.";
        String actual = user.getStatistic();
        assertEquals("must be same", expected, actual);
    }

    @Test
    public void testGetStatistic() throws Exception {
        String expected = "There is no statistical data.";
        String actual = user.getStatistic();
        assertEquals("must be same", expected, actual);
    }

    @Test
    public void testGetUserName() throws Exception {
        assertEquals("must be same", "jack", user.getUserName());
    }

    @Test
    public void testGetPassword() throws Exception {
        assertEquals("must be same", "jack", user.getPassword());
    }

    @Test
    public void testGetHistoryNotNull() throws Exception {
        assertNotNull("must be null", user.getCurrentProgress(""));
    }

    @Test
    public void testToString() throws Exception {
        assertEquals("must be same classes", String.class, user.toString().getClass());
    }
}
